REM This must be run from a folder like c:\dev\dasblog ce\source. The "source" folder is important.
REM If you don't know this, you likely aren't supposed to be releasing dasBlog, eh?
SET DASVERSION=1.8.5223.0
SET DASBLOGFILE=dasBlog-%DASVERSION%-Web-Files.zip
SET DASBLOGSRCFILE=dasBlog-%DASVERSION%-Source.zip

IF EXIST dasblogce rd /s /q dasblogce
IF EXIST upgradedasblog rd /s /q upgradedasblog
md dasblogce
xcopy DasBlogUpgrader\bin\Debug\*.* "upgradedasblog\" /s
xcopy newtelligence.DasBlog.Web\SiteConfig\*.* "dasblogce\SiteConfig\" /s
del dasblogce\SiteConfig\site.config.deploy
del dasblogce\SiteConfig\siteSecurity.config.deploy
copy /y newtelligence.DasBlog.Web\SiteConfig\site.config.deploy dasblogce\SiteConfig\site.config
copy /y newtelligence.DasBlog.Web\SiteConfig\siteSecurity.config.deploy dasblogce\SiteConfig\siteSecurity.config
copy newtelligence.DasBlog.Web\*.webinfo dasblogce
copy newtelligence.DasBlog.Web\*.aspx dasblogce
copy newtelligence.DasBlog.Web\*.ascx dasblogce
copy newtelligence.DasBlog.Web\web.config dasblogce
copy newtelligence.DasBlog.Web\*.asax dasblogce
copy newtelligence.DasBlog.Web\*.asmx dasblogce
copy newtelligence.DasBlog.Web\*.licx dasblogce
copy newtelligence.DasBlog.Web\*.js dasblogce
xcopy newtelligence.DasBlog.Web\*.dll "dasblogce" /s
xcopy newtelligence.DasBlog.Web\*.pdb "dasblogce" /s
xcopy newtelligence.DasBlog.Web\ftb\*.* "dasblogce\ftb\" /s
xcopy newtelligence.DasBlog.Web\images\*.* "dasblogce\images\" /s
xcopy newtelligence.DasBlog.Web\content\*.deploy "dasblogce\content\" /s
ren dasblogce\content\*.deploy *.
xcopy newtelligence.DasBlog.Web\themes\blogxp "dasblogce\themes\blogxp\" /s
xcopy newtelligence.DasBlog.Web\themes\calmblue "dasblogce\themes\calmblue\" /s
xcopy newtelligence.DasBlog.Web\themes\candidblue "dasblogce\themes\candidblue\" /s
xcopy newtelligence.DasBlog.Web\themes\dasBlog "dasblogce\themes\dasBlog\" /s
xcopy newtelligence.DasBlog.Web\themes\discreetBlogBlue "dasblogce\themes\discreetBlogBlue\" /s
xcopy newtelligence.DasBlog.Web\themes\elegante "dasblogce\themes\elegante\" /s
xcopy newtelligence.DasBlog.Web\themes\essence "dasblogce\themes\essence\" /s
xcopy newtelligence.DasBlog.Web\themes\justhtml "dasblogce\themes\justhtml\" /s
xcopy newtelligence.DasBlog.Web\themes\mono "dasblogce\themes\mono\" /s
xcopy newtelligence.DasBlog.Web\themes\movableRadioBlue "dasblogce\themes\movableRadioBlue\" /s
xcopy newtelligence.DasBlog.Web\themes\movableRadioHeat "dasblogce\themes\movableRadioHeat\" /s
xcopy newtelligence.DasBlog.Web\themes\orangeCream "dasblogce\themes\orangeCream\" /s
xcopy newtelligence.DasBlog.Web\themes\Portal "dasblogce\themes\Portal\" /s
xcopy newtelligence.DasBlog.Web\themes\slate "dasblogce\themes\slate\" /s
xcopy newtelligence.DasBlog.Web\themes\soundWaves "dasblogce\themes\soundWaves\" /s
xcopy newtelligence.DasBlog.Web\themes\tricoleur "dasblogce\themes\tricoleur\" /s
xcopy newtelligence.DasBlog.Web\smilies\*.* "dasblogce\smilies\" /s
xcopy newtelligence.DasBlog.Web\DatePicker\*.* "dasblogce\DatePicker\" /s

del dasblogce\.#* /q /s
del upgradedasblog\.#* /q /s
del dasblogce\.cvsignore /q /s
del upgradedasblog\.cvsignore /q /s

del %DASBLOGFILE%
del %DASBLOGSRCFILE%

pushd .
IF not exist md dasblogce
	cd dasblogce
	md logs
	cd ..
cd dasblogce
	IF not exist md content
		cd content
		md binary
popd

PACOMP.EXE -a -r -P -q %DASBLOGFILE% dasblogce\*.*
PACOMP.EXE -a -r -P -q %DASBLOGFILE% upgradedasblog\*.*
PACOMP.EXE -a -q %DASBLOGFILE% *.rtf
PACOMP.EXE -a -q %DASBLOGFILE% *.url
PACOMP.EXE -a -q %DASBLOGFILE% *.vbs

rd /s /q dasblogce
rd /s /q upgradedasblog

REM Now the source
rd /s /q ..\src
md ..\src
xcopy *.* /s /y ..\src
pushd .
cd ..\src
call cleansource .
del *.bat /q /s
del pacomp.exe /q /s
del *.zip /q /s
del *.suo /q /s
del *.log /q /s
del *.backup /q /s
del .#* /q /s
del .cvsignore /q /s
del newtelligence.DasBlog.Web\content\*.xml /q
ren newtelligence.DasBlog.Web\content\*.deploy *.
del newtelligence.DasBlog.Web\content\binary /q
popd
pushd .
cd ..
source\PACOMP.EXE -a -r -P -q source\%DASBLOGSRCFILE% src\*.*
popd 
